new Vue({
    el: '#app',
    data() {
      return {
        form: {
          page: 1,			//页数
          limit: 10			//每页数据条数
        },
        formData: {},
        tableData: [{}],		//表格数据
        total: 1,
        dialogForm: false,
        title: '',
        multipleSelection: []
      }
    },
    mounted() {
      this.getList(this.form)
    },
    methods: {
      onSerach() {				//查询方法
        console.log("搜搜")
      },
      addContract() {
        console.log("跳转")
      },
      getList(data) {     //换页方法
        let _this = this
        $.ajax({
          type: 'POST',
          url: DomainName + "/getprepaymentCardSchemeAction?token="+$.cookie('token'),
          data,
          complete: function (XMLHttpRequest) {
            _this.loading = false
            if (XMLHttpRequest.getResponseHeader("REDIRECT") == "REDIRECT") {
              window.parent.document.location.href = "../../../../" + XMLHttpRequest.getResponseHeader("CONTENTPATH");
            }
          },
          success: function (Result) {
            console.log(Result);
            _this.tableData = Result.tableData      //将获取的数据存到表格数据中
          },
          dataType: "json"
        });
      },
      Delete(row){
        const _this = this;
        $.ajax({
          type: 'POST',
          url: DomainName + "/DeleteAction?token="+$.cookie('token'),
          data:{
            TableName:'prepayment_card_scheme',
            Primary_Key:row.Prepayment_Card_Scheme_SerialNumber,
            Primary_Key_Name:'Prepayment_Card_Scheme_SerialNumber',
          },
          complete: function (XMLHttpRequest) {
            _this.loading = false
            if (XMLHttpRequest.getResponseHeader("REDIRECT") == "REDIRECT") {
              window.parent.document.location.href = "../../../../" + XMLHttpRequest.getResponseHeader("CONTENTPATH");
            }
          },
          success: function (Result) {
            if(Result.Status == 'success'){
              _this.$message({
                message: '删除成功',
                type: 'success'
              });//将获取的数据存到表格数据中
              _this.getList(_this.form)  
            }
          },
          dataType: "json"
        });
      },
      addEnterprise() {
        window.location.href = './Add.html'
      },
      showMember(EnterpriseInfo_SerialNumber) {
        sessionStorage.setItem("EnterpriseInfo_SerialNumber", EnterpriseInfo_SerialNumber)
        window.location.href = './show.html?EnterpriseInfo_SerialNumber=' + EnterpriseInfo_SerialNumber
      },
      editMember(EnterpriseInfo_SerialNumber) {
        sessionStorage.setItem("EnterpriseInfo_SerialNumber", EnterpriseInfo_SerialNumber)
        window.location.href = './Edit.html?EnterpriseInfo_SerialNumber=' + EnterpriseInfo_SerialNumber
      },
      handleSelectionChange(val) {
        this.multipleSelection = val;
      }
    },
  })